package thread1;
/*1)、通过继承java.lang.Thread类的方式创建两个线程，在Thread构造方法中指定线程的名称，
并将这两个线程的名称打印出来。*/
public class MyThread extends Thread{
    public MyThread(String name) {
        super(name);
    }

    public MyThread() {
    }

    @Override
    public void run() {
        System.out.println(this.getName());
    }

    public static void main(String[] args) {
        Thread thread = new MyThread("牛哥");
        Thread thread1 = new MyThread("张政");
        thread.start();
        thread1.start();
    }
}
